package com.base.service.system.entity;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.util.List;

import com.base.core.framework.sql.entity.BaseV1Ext;
import com.base.core.head.converter.ListLongConverterEditor;
import com.gitee.magic.core.converter.PropertyConverter;
import com.gitee.magic.jdbc.persistence.annotation.Entity;
import com.gitee.magic.jdbc.persistence.annotation.Table;
import com.gitee.magic.jdbc.persistence.source.jdbc.script.annotations.ColumnDef;
import com.gitee.magic.jdbc.persistence.source.jdbc.script.annotations.Indexes;
import com.gitee.magic.jdbc.persistence.source.jdbc.script.annotations.ScriptConverter;
import com.gitee.magic.jdbc.persistence.source.jdbc.script.annotations.TableDef;
import com.gitee.magic.jdbc.persistence.source.jdbc.script.annotations.indexes.Unique;
import com.gitee.magic.jdbc.persistence.source.jdbc.script.converter.FieldText;

/**
 * @author start
 */
@Getter@Setter@ToString
@Entity("role")
@Table("sys_role")
@TableDef(comment = "角色")
public class RoleDO extends BaseV1Ext {

	private static final long serialVersionUID = 1L;
	
	public RoleDO(){}

    @ColumnDef(length = 32, comment = "名称")
	private String name;

    @ColumnDef(indexes = @Indexes(unique = @Unique), length = 32, comment = "编码")
	private String code;

    @ColumnDef(comment = "权限Ids")
    @ScriptConverter(FieldText.class)
    @PropertyConverter(ListLongConverterEditor.class)
    private List<Long> authIds;

}

